namespace ChumChase.FriendFeed.Converters
{
    using System;
    using System.Globalization;
    using System.Windows.Data;

    public class NicknameToProfilePicUrlConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string size = (parameter == null)
                              ? "medium"
                              : parameter.ToString();

            string url = string.Format("http://friendfeed.com/{0}/picture?size={1}",
                                       value,
                                       size);
            return url;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}